/**
 * 环境配置封装
 */

interface Iconfig {
  baseApi: string;
  mockApi: string;
}

const env = import.meta.env.MODE || 'prod';
// 是否外测环境
const isTest = location.href.indexOf('cityapp-test') > -1;
const EnvConfig: { [key: string]: Iconfig } = {
  dev: {
    // baseApi: 'http://192.168.0.100/',
    baseApi: '/api/ret/',
    mockApi: 'http://171.93.112.44:3001/mock/14',
  },
  test: {
    baseApi: '/api',
    mockApi: 'http://171.93.112.44:3001/mock/10/api/',
  },
  prod: {
    baseApi: `https://cityapp1.ybdianzi.com/ret${isTest ? '-test' : ''}`,
    mockApi: 'http://171.93.112.44:3001/mock/10/api/',
  },
};

export default {
  env,
  mock: true,
  namespace: 'cityServiceH5',
  staticPath: 'https://cityapp1.ybdianzi.com/static/',
  ...EnvConfig[env],
};
